/*
 * @Author: your name
 * @Date: 2021-11-10 11:26:33
 * @LastEditTime: 2021-11-10 11:34:08
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \epet_back\routes\relation.js
 */
const Router = require('koa-router')
const relationRouter = new Router()
const query = require('../utils/query')

relationRouter.get('/tabs', async ctx => {
    const sql =   `SELECT * FROM relationTabs`
    let result = await query(sql)
    if(result.length > 0) {
        ctx.body = {
            code: 200,
            msg: "获取tabs数据成功！",
            data: result
        } 
    } else {
        ctx.body = {
            code: 201,
            msg: "无相关数据",
            data: []
        } 
    }
})
module.exports = relationRouter